home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
gdead.berkeley.edu
/
gdead.berkeley.edu.tar
/
gdead.berkeley.edu
/
pub
/
gdead
/
mac
/
SOD_1.8.7.sea.hqx
/
SOD 1.8.7
/
Dead Tapes
/
background_2584.txt
< prev
next >
Wrap
Text File
|
1995-01-11
|
18KB
|
760 lines
-- background: 2584 from stack: in
-- bmap block id: 3759
-- flags: 0000
-- background id: 0
-- name:
----- HyperTalk script -----
on newCard
tabKey
end newCard
function findTapeByDate theShowDate
-- a binary search through the cards.
-- this particular version, upon failing to find the show, will
-- leave you on the card immediately PREVIOUS to the date
-- searched for. This makes it easy to insert new shows into
-- the proper place.
--
put the number of this card into origCard
put theShowDate into searchDate
convert searchDate to seconds
put the number of cards into endCard
put trunc( endCard / 2 ) into targetCard
put 1 into begCard
set the cursor to 4
set the lockScreen to true
repeat forever
showBusy
go card targetCard
get field "date"
if it is theShowDate then return true
convert it to seconds
if it > searchDate then
put the number of this card into endCard
else
put the number of this card into begCard
end if
if (endCard - begCard) < 2 then
go card begCard
get field "date"
convert it to seconds
if it is searchDate then return true
go next card
get field "date"
convert it to seconds
if it is searchDate then return true
-- if we reach here the show does not exist yet
-- find the show previous to the one we were looking for
repeat forever
get field "date"
convert it to seconds
if (it < searchDate) or (the number of this card is 1) then exit repeat
go previous card
end repeat
exit repeat
end if
--
put trunc( begCard + ((endCard - begCard) / 2) ) into targetCard
-- put begCard & " : " & targetCard & " : " & endCard
end repeat
hide the message
return false
end findTapeByDate
-- part 40 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=434 top=231 right=253 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: = Stacks =
----- HyperTalk script -----
-- This button will present a pop-up menu of stack names.
-- Hold the mouse button down for a few seconds until
-- the menu appears. Select one of the choices to
-- go to that stack.
on mouseDown
if the commandKey is down then
doHelp
exit mouseDown
end if
--
global stackLast
put true into useLast
if the optionKey is down then put false into useLast
if stackLast is empty then
put "1,1,1,1,1,1" into stackList
put the rect of me into thePt
if item 2 of thePt > 230 then put 230 into item 2 of thePt
put "Shows;Songs;(Tapes;Labels;Stats;Utility" into list
put popUp( thePt, list ) into choice
-- if it is 0, then no choice was made...
if choice is not 0 then
put piece( list, ";", choice ) into theStack
if theStack is not "Songs" then put "Dead " before theStack
set the hilite of me to false
go stack theStack
end if
end if
end mouseDown
-- part 1 (field)
-- low flags: 02
-- high flags: 0000
-- rect: left=105 top=61 right=78 bottom=250
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: date
----- HyperTalk script -----
on closeField
convert field "date" to short date
set name of this card to field "date"
end closeField
on oldCloseField
convert field "date" to short date
set name of this card to field "date"
get field "location"
if it is empty then
set the lockScreen to true
put field "date" into cardName
push this card
go to stack "Dead Shows"
put " " into locName
find cardName in field "date"
if the result is empty then
put field "location" into locName
end if
pop card
if locName is not empty then
put item 1 of locName into field "location"
end if
set the lockScreen to false
end if
end oldCloseField
-- part 2 (field)
-- low flags: 02
-- high flags: 0000
-- rect: left=105 top=81 right=100 bottom=369
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: location
-- part 3 (field)
-- low flags: 02
-- high flags: 0000
-- rect: left=105 top=100 right=117 bottom=173
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: source
-- part 4 (field)
-- low flags: 02
-- high flags: 0000
-- rect: left=105 top=119 right=136 bottom=173
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: gen
-- part 5 (field)
-- low flags: 02
-- high flags: 0000
-- rect: left=105 top=139 right=156 bottom=174
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: quality
-- part 6 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=104 top=159 right=273 bottom=353
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: comments
-- part 7 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=429 top=308 right=335 bottom=459
-- title width / last selected line: 0
-- icon id / first selected line: 20689 / 20689
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
-- This button sends you to the Home stack.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
lock screen
go stack "Dead Utility"
playDeadSong "Franklins"
go "Home"
unlock screen with visual effect iris close
end mouseUp
-- part 9 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=385 top=54 right=86 bottom=444
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
-- This button will send you to the previous card.
on mouseDown
go prev card
repeat while the mouse is down
go to prev card
end repeat
end mouseDown
-- part 10 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=427 top=88 right=125 bottom=468
-- title width / last selected line: 0
-- icon id / first selected line: 20186 / 20186
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
-- This screen will sort the cards in this stack
-- by date.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
set the cursor to watch
set the lockScreen to true
push this card
sort datetime by field "date"
pop card
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=465 top=302 right=336 bottom=500
-- title width / last selected line: 0
-- icon id / first selected line: 1012 / 1012
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: return
----- HyperTalk script -----
-- This button will return you to where you came from.
-- This assumes that the handler that sent you here did
-- a push card.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
visual effect iris close fast
pop card
end mouseUp
-- part 18 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=434 top=156 right=178 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Import...
----- HyperTalk script -----
-- This button will import a text file which contains a
-- tape list with one tape entry per line. It will skip
-- blank lines and lines which do not have a valid date
-- in the first word.
--
-- Fields should be separated by a single tab. Format:
--
-- date, location, source, gen, quality, comment
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
global deadDir
ask "Import which file:" with deadDir
if the length of it < 6 then exit mouseUp
put it into fileName
open file fileName
put true into askUser
repeat forever
read from file fileName until return
if it is empty then
exit repeat
end if
put Trim(it) into record
if record is empty then next repeat -- blank line filter
-- was converting here....
put piece( record, tab, 1 ) into testDate
convert testDate to dateitems
if the number of items in testDate < 5 then next repeat
domenu "New Card"
get piece( record, tab, 1 )
convert it to short date
put it into field "date"
set the name of this card to it
-- risky... assumes field order
repeat with i = 2 to number of fields
put Trim(piece( record, tab, i )) into field i
end repeat
if askUser is true then
answer "Again?" with "CANCEL" or "Do All" or "OK"
if it is "CANCEL" then exit repeat
if it is "Do All" then put false into askUser
end if
end repeat
close file fileName
end mouseUp
on foo
repeat with i = 1 to the length of record
if character i of record is tab then
put "," into character i of record
next repeat
end if
if character i of record is "," then
put " " into character i of record
end if
end repeat
end foo
-- part 19 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=434 top=183 right=205 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Export...
----- HyperTalk script -----
-- This button will export the tape records in this stack
-- to a text file with one tape entry per line.
-- The format used is shown below, and is the same format
-- required by the import function.
--
-- Fields should be separated by a single tab. Format:
--
-- date, location, source, gen, quality, comment
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
push this card
set the lockScreen to true
go stack "Dead Utility"
go to card "tape list"
set the lockScreen to false
end mouseUp
-- part 27 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=38 top=193 right=266 bottom=93
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: play
----- HyperTalk script -----
-- This button will play a random tune.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
playRandomDead
end mouseUp
-- part 28 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=384 top=130 right=152 bottom=427
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New
----- HyperTalk script -----
-- This button will create a new tape card. It will
-- prompt for a date and automatically fetch the location
-- from the Shows stack.
on mouseUp
if the commandKey is down then
doHelp
else if the optionKey is down then
doMenu "Copy Card"
doMenu "Paste Card"
click at the loc of field "date"
else
set the lockScreen to true
setUpNewCard
end if
end mouseUp
on setUpNewCard
ask "Date of the show:"
if it is not empty then
convert it to short date
put it into showDate
convert it to dateItems
put item 1 of it into theYear
if findTapeByDate( showDate ) is false then
doMenu "New Card"
put showDate into field "date"
put 19 & piece( the short date, "/", 3 ) into thisYear
if theYear >=1965 and theYear <= thisYear then
push this card
go to stack "Dead Shows"
put " " into locName
put findShowByDate( showDate ) into foundIt
if foundIt is true then
put field "location" into locName
end if
pop card
if locName is not empty then
put item 1 of locName into field "location"
end if
end if
end if
click at the loc of field "location"
end if
end setUpNewCard
-- part 30 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=434 top=130 right=152 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Go to...
----- HyperTalk script -----
-- This button will look for a tape for a show of
-- a date you will enter. If it does not find it,
-- it will go to the first tape with a date later than
-- the one entered.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
ask "Enter the show date:"
if it is empty then exit mouseUp
put it into theShow
convert theShow to short date
put findTapeByDate( theShow ) into temp
end mouseUp
-- part 34 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=426 top=23 right=54 bottom=463
-- title width / last selected line: 0
-- icon id / first selected line: 128 / 128
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Labels
----- HyperTalk script -----
-- This button will send you to the labels stack. It will
-- find the labels for this tape, if they exist. If they
-- do not then it will offer to make them via the standard
-- function for creating them, which will visit the shows
-- stack to obtain the set lists.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
put field "date" into showDate
put field "location" into Venue
push this card
set the lockScreen to true
go to stack "Dead Labels"
find showDate in field "date"
-- go card cardName
if the result is not empty then
answer "No labels. Shall we make 'em?" with "Cancel" or "Don't Bother!" or "OK"
if it is "Cancel" then
pop card
exit mouseUp
else if it is "OK" then
newLabels( ShowDate )
end if
end if
end mouseUp
-- part 39 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=384 top=155 right=177 bottom=427
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: List
----- HyperTalk script -----
-- This button will display the list of your tapes in
-- a scrolling field. Click opn the field to make it
-- dissappear.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
push this card
lock Screen
go card 1
put empty into theList
repeat for the number of cards
-- build the list...
showBusy
--put field "date" & " " ¬ -- old way
put ExpandTabs( field "date" & tab, 10 ) & item 1 of field "location" & " : " & line 1 of field "comments" & return after theList
go next card
end repeat
pop card
show field "Tape List"
put the number of cards & " shows on file..." & return & "---------------" & return & theList into field "Tape List"
unlock Screen with visual effect dissolve
end mouseUp
-- part 35 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=397 top=309 right=331 bottom=419
-- title width / last selected line: 0
-- icon id / first selected line: 26635 / 26635
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
-- This button will provide some general help about
-- this stack.
on mouseUp
if the commandKey is down then
doHelp
exit mouseUp
end if
--
push this card
go card "Tapes Help" of stack "Dead Utility"
playDead "help"
end mouseUp
-- part 37 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=448 top=54 right=86 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
-- This button will send you to the next card.
on mouseDown
go next card
repeat while the mouse is down
go to next card
end repeat
end mouseDown
-- part 38 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=9 top=31 right=337 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Tape List
----- HyperTalk script -----
on mouseUp
lock screen
hide me
put empty into me
set the scroll of me to 0
unlock screen with visual effect dissolve
end mouseUp
-- part 41 (field)
-- low flags: 9D
-- high flags: 2007
-- rect: left=30 top=103 right=318 bottom=449
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 256
-- line height: 13
-- part name: help text
----- HyperTalk script -----
on mouseUp
lock screen
hide me
unlock screen with visual effect dissolve fast
end mouseUp